<?php

/**
 * Cadvaloresbolsa form base class.
 *
 * @method Cadvaloresbolsa getObject() Returns the current form's model object
 *
 * @package    SCBE
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseCadvaloresbolsaForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'idvaloresbolsa'        => new sfWidgetFormInputHidden(),
      'idmodalidadepagamento' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Cadmodalidadepagamento'), 'add_empty' => false)),
      'idgrupopagamento'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Cadgrupopagamento'), 'add_empty' => false)),
      'idnivel'               => new sfWidgetFormInputText(),
      'valoresbolsa'          => new sfWidgetFormInputText(),
      'idmoeda'               => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Cadmoeda'), 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'idvaloresbolsa'        => new sfValidatorChoice(array('choices' => array($this->getObject()->get('idvaloresbolsa')), 'empty_value' => $this->getObject()->get('idvaloresbolsa'), 'required' => false)),
      'idmodalidadepagamento' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Cadmodalidadepagamento'))),
      'idgrupopagamento'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Cadgrupopagamento'))),
      'idnivel'               => new sfValidatorInteger(),
      'valoresbolsa'          => new sfValidatorNumber(),
      'idmoeda'               => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Cadmoeda'))),
    ));

    $this->widgetSchema->setNameFormat('cadvaloresbolsa[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Cadvaloresbolsa';
  }

}
